package com.kungfuhacking.wristbandpro.my.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.kungfuhacking.wristbandpro.base.bean.Basebean;

import java.util.List;

/**
 * Created by Administrator on 2015/8/17.
 */
public class OldDetail extends Basebean implements Parcelable {

    private DataEntity data;
    private int mylevel;
    private List<KeepEntity> keep;

    public DataEntity getData() {
        return data;
    }

    public void setData(DataEntity data) {
        this.data = data;
    }

    public int getMylevel() {
        return mylevel;
    }

    public void setMylevel(int mylevel) {
        this.mylevel = mylevel;
    }

    public List<KeepEntity> getKeep() {
        return keep;
    }

    public void setKeep(List<KeepEntity> keep) {
        this.keep = keep;
    }

    public static class DataEntity implements Parcelable {

        private String childName;
        private String sex;
        private String picUrl;
        private String birthDay;
        private String phoneNum;

        public String getChildName() {
            return childName;
        }

        public void setChildName(String childName) {
            this.childName = childName;
        }

        public String getSex() {
            return sex;
        }

        public void setSex(String sex) {
            this.sex = sex;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }

        public String getBirthDay() {
            return birthDay;
        }

        public void setBirthDay(String birthDay) {
            this.birthDay = birthDay;
        }

        public String getPhoneNum() {
            return phoneNum;
        }

        public void setPhoneNum(String phoneNum) {
            this.phoneNum = phoneNum;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.childName);
            dest.writeString(this.sex);
            dest.writeString(this.picUrl);
            dest.writeString(this.birthDay);
            dest.writeString(this.phoneNum);
        }

        public DataEntity() {
        }

        protected DataEntity(Parcel in) {
            this.childName = in.readString();
            this.sex = in.readString();
            this.picUrl = in.readString();
            this.birthDay = in.readString();
            this.phoneNum = in.readString();
        }

        public static final Parcelable.Creator<DataEntity> CREATOR = new Parcelable.Creator<DataEntity>() {
            @Override
            public DataEntity createFromParcel(Parcel source) {
                return new DataEntity(source);
            }

            @Override
            public DataEntity[] newArray(int size) {
                return new DataEntity[size];
            }
        };
    }

    public static class KeepEntity implements Parcelable {

        private int level;
        private String name;
        private String phoneNum;
        private String imgUrl;
        private String id;

        public int getLevel() {
            return level;
        }

        public void setLevel(int level) {
            this.level = level;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getPhoneNum() {
            return phoneNum;
        }

        public void setPhoneNum(String phoneNum) {
            this.phoneNum = phoneNum;
        }

        public String getImgUrl() {
            return imgUrl;
        }

        public void setImgUrl(String imgUrl) {
            this.imgUrl = imgUrl;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.level);
            dest.writeString(this.name);
            dest.writeString(this.phoneNum);
            dest.writeString(this.imgUrl);
            dest.writeString(this.id);
        }

        public KeepEntity() {
        }

        protected KeepEntity(Parcel in) {
            this.level = in.readInt();
            this.name = in.readString();
            this.phoneNum = in.readString();
            this.imgUrl = in.readString();
            this.id = in.readString();
        }

        public static final Parcelable.Creator<KeepEntity> CREATOR = new Parcelable.Creator<KeepEntity>() {
            @Override
            public KeepEntity createFromParcel(Parcel source) {
                return new KeepEntity(source);
            }

            @Override
            public KeepEntity[] newArray(int size) {
                return new KeepEntity[size];
            }
        };
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.data, flags);
        dest.writeInt(this.mylevel);
        dest.writeTypedList(this.keep);
    }

    public OldDetail() {
    }

    protected OldDetail(Parcel in) {
        this.data = in.readParcelable(DataEntity.class.getClassLoader());
        this.mylevel = in.readInt();
        this.keep = in.createTypedArrayList(KeepEntity.CREATOR);
    }

    public static final Parcelable.Creator<OldDetail> CREATOR = new Parcelable.Creator<OldDetail>() {
        @Override
        public OldDetail createFromParcel(Parcel source) {
            return new OldDetail(source);
        }

        @Override
        public OldDetail[] newArray(int size) {
            return new OldDetail[size];
        }
    };
}
